
import { lazy } from 'react'
import {Navigate} from 'react-router-dom'

var Home = lazy(()=>import('@/views/Index/Home/Home.tsx'))
var Vehicle = lazy(()=>import('@/views/Index/Home/vehicle/Vehicle.tsx'))
var Management = lazy(()=>import('@/views/Index/Home/vehicle/Management.tsx'))
var Carscore = lazy(()=>import('@/views/Index/Home/vehicle/Carscore.tsx'))
var AddCarscore = lazy(()=>import('@/views/Index/Home/vehicle/AddCarscore.tsx'))
var Returncar = lazy(()=>import('@/views/Index/Home/vehicle/Returncar.tsx'))
var AddReturncar = lazy(()=>import('@/views/Index/Home/vehicle/AddReturncar.tsx'))
var Newsmanage = lazy(()=>import('@/views/Index/Home/Newsmanage/Newsmanage.tsx'))
var Newslist = lazy(()=>import('@/views/Index/Home/Newsmanage/Newslist.tsx'))
var Addnew = lazy(()=>import('@/views/Index/Home/Newsmanage/Addnew.tsx'))
var Addcar = lazy(()=>import('@/views/Index/Home/vehicle/Addcar.tsx'))
var NotFound = lazy(()=>import('@/views/NotFound/NotFound.tsx'))
var Workbench = lazy(()=>import('@/views/Index/Home/workbench/Workbench.tsx'))
var Agenda = lazy(()=>import('@/views/Index/Home/agenda/Agenda.tsx'))

export default [
            {
                path:'/index/home',
                element: <Home />,
                children:[
                    {
                        path:'/index/home/workbench',
                        element: <Workbench />
                    },
                    {
                        path:'/index/home/agenda',
                        element: <Agenda />
                    },
                    {
                        path:'/index/home',
                        element: <Navigate to="/index/home/workbench" />
                    },
                    {
                        path:'*',
                        element: <NotFound />
                    }
                ]
            },   
            {
                path:'/index/Vehicle',
                element: <Vehicle />,
                children:[
                    {
                        path:'/index/Vehicle/management',
                        element: <Management />
                    },
                    {
                        path:'/index/Vehicle/addcar',
                        element: <Addcar />
                    },
                    {
                        path:'/index/Vehicle/carscore',
                        element: <Carscore />
                    },
                    {
                        path:'/index/Vehicle/returncar',
                        element: <Returncar />
                    },
                    {
                        path:'/index/Vehicle/addCarscore',
                        element: <AddCarscore />
                    },
                    {
                        path:'/index/Vehicle/addReturncar',
                        element: <AddReturncar />
                    },
                  
                    {
                        path:'/index/Vehicle',
                        element: <Navigate to="/index/Vehicle/management" />
                    },
                    {
                        path:'*',
                        element: <NotFound />
                    }
                ]
            } ,  
            {
                path:'/index/newsmanage',
                element: <Newsmanage />,
                children:[
                    {
                        path:'/index/newsmanage/newslist',
                        element: <Newslist />
                    },
                    {
                        path:'/index/newsmanage/addnew',
                        element: <Addnew />
                    },
                    {
                        path:'/index/newsmanage',
                        element: <Navigate to="/index/newsmanage/newslist" />
                    },
                    {
                        path:'*',
                        element: <NotFound />
                    }
                ]
            }   
]